/*
 * @Author: yuanchenxi 836909158@qq.com
 * @Date: 2024-07-24 16:57:31
 * @LastEditors: Wang Shuo wangshuo@sgsimulation.com
 * @LastEditTime: 2024-08-30 10:33:01
 * @FilePath: \SGFEM\DataStructure\FEM\Constraint\include\RSPLINEData.h
 */

#pragma once
#include <vector>

#include "DataStructure/Common/DataStructureExport.h"
#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Element/ElementBase.h"
#include "DataStructure/Input/Solver/DOFDirections.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN
struct DECLSPEC RSPLINEData : public ElementBase
{
    struct DECLSPEC NodeComponent
    {
        SG::DataStructure::Common::Id  m_nodeId = 0;  ///< 节点id
        SG::DataStructure::Common::I64 m_dofs   = 0;  ///< 参与约束方程的自由度方向

        /**
         * @brief 获取参与约束方程的自由度方向
         *
         * 返回参与约束方程的自由度方向的实例。
         *
         * @return 参与约束方程的自由度方向的实例
         */
        SG::DataStructure::FEM::DofSet GetDofs () const;
    };

    SG::DataStructure::Common::Real m_slender  = 0.1;  ///< 长细比系数 DBYL D/L
    SG::DataStructure::Common::Id   m_g1       = 0;    ///< 节点号
    SG::DataStructure::Common::Id   m_domainId = 0;
    std::vector<NodeComponent>      m_items;           ///< 各个节点对单元贡献
};

/// @brief 判断两个NodeComponent是否相等
/// @param a
/// @param b
/// @return
DECLSPEC bool operator== (const RSPLINEData::NodeComponent &a, const RSPLINEData::NodeComponent &b);

/// @brief 判断两个RSPLINEData是否相等
/// @param a
/// @param b
/// @return
DECLSPEC bool operator== (const RSPLINEData &a, const RSPLINEData &b);

SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE